import request from '@/request/request.js'

// 获取商城横幅列表
export const mallBanner = (params) => {
	return request({
		url: "/api/wanlshop/common/adverts",
		method: "GET",
		data: params,
	})
}

// 获取商品分类
export const mallTypeList = (params) => {
	return request({
		url: "/api/wanlshop/common/init",
		method: "GET",
		data: params,
	})
}

// 获取商品列表
export const mallGoodsList = (params) => {
	return request({
		url: "/api/wanlshop/common/category",
		method: "GET",
		data: params,
	})
}

// 获取店铺信息
export const mallShopInfo = (params) => {
	return request({
		url: "/api/wanlshop/shop/getShopInfo",
		method: "GET",
		data: params,
	})
}

// 商品搜索
export const mallGoodsSearch = (params) => {
	return request({
		url: "/api/wanlshop/product/lists",
		method: "GET",
		data: params,
	})
}

// 获取商品详情
export const mallGoodsDetail = (params) => {
	return request({
		url: "/api/wanlshop/product/goods",
		method: "GET",
		data: params,
	})
}

// 商品评论
export const mallGoodsComment = (params) => {
	return request({
		url: "/api/wanlshop/product/comment",
		method: "GET",
		data: params,
	})
}

// 更新购物车
export const mallReCart = (params) => {
	return request({
		url: "/api/wanlshop/cart/storage",
		method: "POST",
		data: params,
	})
}

// 购物车数据
export const mallCart = (params) => {
	return request({
		url: "/api/wanlshop/cart/synchro",
		method: "POST",
		data: params,
	})
}

// 获取结算订单列表
export const mallOrderGoodsList = (params) => {
	return request({
		url: "/api/wanlshop/order/getOrderGoodsList",
		method: "POST",
		data: params,
	})
}

// 添加商品订单
export const mallAddOrder = (params) => {
	return request({
		url: "/api/wanlshop/order/addOrder",
		method: "POST",
		data: params,
	})
}

// 获取该规格数量
export const mallSkuStock = (params) => {
	return request({
		url: "/api/wanlshop/product/stock",
		method: "POST",
		data: params,
	})
}

// 查询可用优惠券列表
export const mallCoupon = (params) => {
	return request({
		url: "/api/wanlshop/coupon/query",
		method: "POST",
		data: params,
	})
}

// 获取虚拟币余额信息
export const mallPayBalance = (params) => {
	return request({
		url: "/api/wanlshop/pay/getBalance",
		method: "POST",
		data: params,
	})
}

// 支付
export const mallPayment = (params) => {
	return request({
		url: "/api/wanlshop/pay/payment",
		method: "POST",
		data: params,
	})
}